package com.stx.jeepay.payment.channel;

import com.stx.jeepay.core.entity.PayOrderEntity;
import com.stx.jeepay.core.entity.RefundOrderEntity;
import com.stx.jeepay.payment.model.MchAppConfigContext;
import com.stx.jeepay.payment.rqrs.msg.ChannelRetMsg;
import com.stx.jeepay.payment.rqrs.refund.RefundOrderRQ;

/**
 * 调起上游渠道侧退款接口
 */
public interface IRefundService {

    /** 获取到接口code **/
    String getIfCode();

    /** 前置检查如参数等信息是否符合要求， 返回错误信息或直接抛出异常即可  */
    String preCheck(RefundOrderRQ bizRQ, RefundOrderEntity refundOrder, PayOrderEntity payOrder);

    /** 调起退款接口，并响应数据；  内部处理普通商户和服务商模式  **/
    ChannelRetMsg refund(RefundOrderRQ bizRQ, RefundOrderEntity refundOrder, PayOrderEntity payOrder, MchAppConfigContext mchAppConfigContext) throws Exception;

    /** 退款查单接口  **/
    ChannelRetMsg query(RefundOrderEntity refundOrder, MchAppConfigContext mchAppConfigContext) throws Exception;
}
